﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:DevExpress.AgMenu;assembly=DevExpress.AgMenu.v8.2"
  xmlns:menuDefaultStyle="clr-namespace:DevExpress.AgMenu.DefaultStyle;assembly=DevExpress.AgMenu.v8.2"
  xmlns:menuInternal="clr-namespace:DevExpress.AgMenu.Internal;assembly=DevExpress.AgMenu.v8.2"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">

    <ControlTemplate x:Key="AgMenuItemHorizontalContentPresenterTemplate" TargetType="menuInternal:AgMenuItemContentPresenter">
        <Grid x:Name="ElementRoot" Margin="{TemplateBinding Padding}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="ElementIconCheckAreaContainer" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
                <Grid x:Name="ElementIconCheckArea">
                    <Grid x:Name="ElementIconAreaContainer">
                        <Grid x:Name="ElementIconArea">
                            <ContentControl x:Name="ElementIcon"
                              Content="{TemplateBinding Icon}"
                              Foreground="{TemplateBinding Foreground}"
                              Margin="0,1,4,1"/>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
            <ContentControl
              Content="{TemplateBinding Header}"
              ContentTemplate="{TemplateBinding HeaderTemplate}"
              Foreground="{TemplateBinding Foreground}"
              Grid.Column="1"
              Grid.Row="0"
              VerticalAlignment="Center"/>
            <ContentControl x:Name="ElementContent"
              Content="{TemplateBinding Content}"
              ContentTemplate="{TemplateBinding ContentTemplate}"
              Foreground="{TemplateBinding Foreground}"
              Grid.Column="1"
              Grid.Row="0"/>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="AgMenuItemVerticalContentPresenterTemplate" TargetType="menuInternal:AgMenuItemContentPresenter">
        <Grid x:Name="ElementRoot" Margin="{TemplateBinding Padding}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Rectangle x:Name="ElementRadio" Grid.ColumnSpan="2" Fill="YellowGreen" Stroke="Gray" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
            <Rectangle x:Name="ElementCheck" Grid.ColumnSpan="2" Fill="YellowGreen" Stroke="Gray" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
            <Grid x:Name="ElementIconCheckAreaContainer" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
                <Grid x:Name="ElementIconCheckArea">
                    <Grid x:Name="ElementIconAreaContainer">
                        <Grid x:Name="ElementIconArea">
                            <ContentControl x:Name="ElementIcon"
                              Content="{TemplateBinding Icon}"
                              Foreground="{TemplateBinding Foreground}"/>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
            <ContentControl
              Content="{TemplateBinding Header}"
              ContentTemplate="{TemplateBinding HeaderTemplate}"
              Foreground="{TemplateBinding Foreground}"
              Grid.Column="1"
              Grid.Row="0"
              VerticalAlignment="Center"/>
            <ContentControl x:Name="ElementContent"
              Content="{TemplateBinding Content}"
              ContentTemplate="{TemplateBinding ContentTemplate}"
              Foreground="{TemplateBinding Foreground}"
              Grid.Column="1"
              Grid.Row="0"/>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="AgMenuItemVerticalPopupMenuItemContentPresenterTemplate" TargetType="menuInternal:AgMenuItemContentPresenter">
        <Grid x:Name="ElementRoot">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="ElementIconCheckAreaContainer" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
                <Grid x:Name="ElementIconCheckArea">
                    <Grid MinWidth="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid x:Name="ElementCheckAreaContainer" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
                            <Grid x:Name="ElementCheckArea" MinWidth="9" Margin="0,0,5,0">
                                <Path x:Name="ElementCheck"
                                                      Stretch="Fill" Margin="0,0,0,1" Fill="#FF000000" Data="F1 M 398,289L 397,288L 392,293L 390,291L 389,292L 392,295L 398,289 Z " Height="7" Width="9"/>
                                <Ellipse x:Name="ElementRadio" Height="7" Margin="0,0,0,1" Width="7" Fill="#FFFFFFFF" Stroke="#FF000000" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>
                        </Grid>
                        <Grid x:Name="ElementIconAreaContainer" Grid.Column="1" Grid.Row="0" VerticalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="ElementIconArea">
                                <ContentControl x:Name="ElementIcon"
                                  Content="{TemplateBinding Icon}"
                                  Foreground="{TemplateBinding Foreground}"
                                  Margin="0,1,5,1"/>
                            </Grid>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
            <ContentControl
              Content="{TemplateBinding Header}"
              ContentTemplate="{TemplateBinding HeaderTemplate}"
              Foreground="{TemplateBinding Foreground}"
              Grid.Column="1"
              Grid.Row="0"
              VerticalAlignment="Center"/>
            <ContentControl x:Name="ElementContent"
              Content="{TemplateBinding Content}"
              ContentTemplate="{TemplateBinding ContentTemplate}"
              Foreground="{TemplateBinding Foreground}"
              Grid.Column="1"
              Grid.Row="0"/>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="AgMenuItemVerticalPopupMenuSubItemContentPresenterTemplate" TargetType="menuInternal:AgMenuItemContentPresenter">
        <Grid x:Name="ElementRoot">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="ElementIconCheckAreaContainer" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
                <Grid x:Name="ElementIconCheckArea">
                    <Grid MinWidth="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid x:Name="ElementCheckAreaContainer" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="ElementCheckArea" MinWidth="9" Margin="0,0,5,0">
                                <Path x:Name="ElementCheck"
                                                      Stretch="Fill" Margin="0,0,0,1" Fill="#FF000000" Data="F1 M 398,289L 397,288L 392,293L 390,291L 389,292L 392,295L 398,289 Z " Height="7" Width="9"/>
                                <Ellipse x:Name="ElementRadio" Height="7" Margin="0,0,0,1" Width="7" Fill="#FFFFFFFF" Stroke="#FF000000" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>
                        </Grid>
                        <Grid x:Name="ElementIconAreaContainer" Grid.Column="1" Grid.Row="0" VerticalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="ElementIconArea">
                                <ContentControl x:Name="ElementIcon"
                                  Content="{TemplateBinding Icon}"
                                  Foreground="{TemplateBinding Foreground}"
                                  Margin="0,1,5,1"/>
                            </Grid>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
            <ContentControl
              Content="{TemplateBinding Header}"
              ContentTemplate="{TemplateBinding HeaderTemplate}"
              Foreground="{TemplateBinding Foreground}"
              Grid.Column="1"
              Grid.Row="0"
              VerticalAlignment="Center"/>
            <ContentControl x:Name="ElementContent"
              Content="{TemplateBinding Content}"
              ContentTemplate="{TemplateBinding ContentTemplate}"
              Foreground="{TemplateBinding Foreground}"
              Grid.Column="1"
              Grid.Row="0"/>
        </Grid>
    </ControlTemplate>

    <local:AgMenuTemplateList x:Key="ItemContainerTemplates">
        <local:AgMenuTemplateListItem Key="AgMenuItem;Horizontal">
            <local:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="local:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFDEDEDE"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFF1F1F1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFC6C6C6"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFE5E5E5"/>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementLeftBorder" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="DroppedDown">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFB7B7B7"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFD3D3D3"/>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementLeftBorder" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border HorizontalAlignment="Stretch" Width="Auto" Grid.ColumnSpan="1" CornerRadius="0,0,0,0">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="#FFDEDEDE"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="#FFF1F1F1" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <menuDefaultStyle:AgHorizontalMenuItemDefaultStyleHelper Position="{TemplateBinding Position}"/>
                                <Border x:Name="ElementLeftBorder" Width="1" VerticalAlignment="Stretch" Grid.Column="0">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#19FDFDFD"/>
                                            <GradientStop Color="#19FDFDFD" Offset="1"/>
                                            <GradientStop Color="#FFFDFDFD" Offset="0.5"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                                <menuInternal:AgMenuItemContentPresenter x:Name="ElementContentPresenter" Grid.Column="1"
							  CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
							  Header="{TemplateBinding Header}"
							  HeaderTemplate="{TemplateBinding HeaderTemplate}"
							  Icon="{TemplateBinding Icon}"
							  IsRadioItem="{TemplateBinding IsRadioItem}"
							  MenuOrientation="{TemplateBinding MenuOrientation}"
							  Padding="24,5,24,5"
							  Template="{StaticResource AgMenuItemHorizontalContentPresenterTemplate}"
							  VerticalAlignment="Center"
							  ViewStyle="{TemplateBinding ViewStyle}"
							  Position="{TemplateBinding Position}"/>
                                <Border Width="1" VerticalAlignment="Stretch" Grid.Column="2" HorizontalAlignment="Right">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                            <GradientStop Color="#FF6E6E6E"/>
                                            <GradientStop Color="#FFC1C1C1" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                            </Grid>
                        </Border>
                        <Popup x:Name="ElementPopup"/>
                    </Grid>
                </ControlTemplate>
            </local:AgMenuTemplateListItem.Template>
        </local:AgMenuTemplateListItem>
        <local:AgMenuTemplateListItem Key="AgMenuItem;Vertical">
            <local:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="local:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFDEDEDE"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFDEDEDE"/>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementTopBorder" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="DroppedDown">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="#FF222222"/>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementTopBorder" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="#FF222222"/>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementTopBorder" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFD2D2D2"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFD2D2D2"/>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementTopBorder" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border HorizontalAlignment="Stretch" Grid.ColumnSpan="1" CornerRadius="0,0,0,0">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="#FFECECEC"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="#FFECECEC" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <menuDefaultStyle:AgVerticalMenuItemDefaultStyleHelper Position="{TemplateBinding Position}"/>
                                <Border x:Name="ElementTopBorder" Height="1" HorizontalAlignment="Stretch" Grid.Row="0" Background="#FFF5F5F5"/>
                                <Grid Grid.Row="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <menuInternal:AgMenuItemContentPresenter x:Name="ElementContentPresenter" Grid.Column="0"
								  CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
								  Header="{TemplateBinding Header}"
								  HeaderTemplate="{TemplateBinding HeaderTemplate}"
								  Icon="{TemplateBinding Icon}"
								  IsRadioItem="{TemplateBinding IsRadioItem}"
								  MenuOrientation="{TemplateBinding MenuOrientation}"
								  Padding="11,4,24,5"
								  Template="{StaticResource AgMenuItemVerticalContentPresenterTemplate}"
								  VerticalAlignment="Top"
								  ViewStyle="{TemplateBinding ViewStyle}"
								  Position="{TemplateBinding Position}"/>
                                    <menuDefaultStyle:AgMenuSubItemArrowDefaultStyleHelper Grid.Column="1" Margin="0,0,7,1">
                                        <menuDefaultStyle:AgMenuSubItemArrowDefaultStyleHelper.Background>
                                            <SolidColorBrush x:Name="ElementArrowBrush" Color="#FF505050"/>
                                        </menuDefaultStyle:AgMenuSubItemArrowDefaultStyleHelper.Background>
                                    </menuDefaultStyle:AgMenuSubItemArrowDefaultStyleHelper>
                                </Grid>
                                <Border Height="1" HorizontalAlignment="Stretch" Grid.Row="2" VerticalAlignment="Bottom" Background="#FFC9C9C9"/>
                            </Grid>
                        </Border>
                        <Popup x:Name="ElementPopup"/>
                    </Grid>
                </ControlTemplate>
            </local:AgMenuTemplateListItem.Template>
        </local:AgMenuTemplateListItem>
        <local:AgMenuTemplateListItem Key="AgMenuItem;Vertical;PopupMenuItem">
            <local:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="local:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal"/>
                                <vsm:VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFBDD9F8"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFD2E5FA"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="DroppedDown"/>
                                <vsm:VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFBDD9F8"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFD2E5FA"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FF6FA2DD"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FF8FB8E5"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border HorizontalAlignment="Stretch" Margin="1,1,1,0" Width="Auto" CornerRadius="2,2,2,2">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="Transparent"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="Transparent" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto">
                            <menuInternal:AgMenuItemContentPresenter x:Name="ElementContentPresenter"
						  CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
						  Header="{TemplateBinding Header}"
						  HeaderTemplate="{TemplateBinding HeaderTemplate}"
						  Icon="{TemplateBinding Icon}"
						  IsRadioItem="{TemplateBinding IsRadioItem}"
						  Margin="8,4,30,3"
						  MenuOrientation="{TemplateBinding MenuOrientation}"
						  Template="{StaticResource AgMenuItemVerticalPopupMenuItemContentPresenterTemplate}"
						  ViewStyle="{TemplateBinding ViewStyle}"
						  Position="{TemplateBinding Position}"/>
                        </Border>
                        <Popup x:Name="ElementPopup"/>
                    </Grid>
                </ControlTemplate>
            </local:AgMenuTemplateListItem.Template>
        </local:AgMenuTemplateListItem>
        <local:AgMenuTemplateListItem Key="AgMenuItem;Vertical;PopupMenuSubItem">
            <local:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="local:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal"/>
                                <vsm:VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFBDD9F8"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFD2E5FA"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="DroppedDown"/>
                                <vsm:VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFBDD9F8"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFD2E5FA"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FF6FA2DD"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FF8FB8E5"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border HorizontalAlignment="Stretch" Margin="1,1,1,0" Width="Auto" CornerRadius="2,2,2,2">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="Transparent"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="Transparent" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" Padding="8,4,8,3">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <menuInternal:AgMenuItemContentPresenter x:Name="ElementContentPresenter" Grid.Column="0"
							  CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
							  Header="{TemplateBinding Header}"
							  HeaderTemplate="{TemplateBinding HeaderTemplate}"
							  Icon="{TemplateBinding Icon}"
							  IsRadioItem="{TemplateBinding IsRadioItem}"
							  Margin="0,0,30,0"
							  MenuOrientation="{TemplateBinding MenuOrientation}"
							  Template="{StaticResource AgMenuItemVerticalPopupMenuSubItemContentPresenterTemplate}"
							  ViewStyle="{TemplateBinding ViewStyle}"
							  Position="{TemplateBinding Position}"/>
                                <Path x:Name="BlackTriangle"
							  Stretch="Fill" Fill="#FF3D3D3D" 
							  Data="F1 M 394,286L 400,283L 400,282L 394,279L 394,286 Z " Height="7" Width="6" Grid.Column="1"/>
                            </Grid>
                        </Border>
                        <Popup x:Name="ElementPopup"/>
                    </Grid>
                </ControlTemplate>
            </local:AgMenuTemplateListItem.Template>
        </local:AgMenuTemplateListItem>
        <local:AgMenuTemplateListItem Key="AgMenuSeparator;Vertical;PopupMenuItem">
            <local:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="local:AgMenuSeparator">
                    <Border Height="1" Margin="8,1,8,0" Background="#FF929292" BorderThickness="0,0,0,0"/>
                </ControlTemplate>
            </local:AgMenuTemplateListItem.Template>
        </local:AgMenuTemplateListItem>
    </local:AgMenuTemplateList>

    <Style TargetType="local:AgMenu">
        <Setter Property="Foreground" Value="#FF6E6E6E"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <menuInternal:AgMenuPanel/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerTemplates" Value="{StaticResource ItemContainerTemplates}"/>
        <Setter Property="TemplateCollection">
            <Setter.Value>
                <local:AgMenuTemplateList>
                    <local:AgMenuTemplateListItem Key="Horizontal">
                        <local:AgMenuTemplateListItem.Template>
                            <ControlTemplate TargetType="local:AgMenu">
                                <Border CornerRadius="5,5,5,5" Padding="1,1,1,1">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                            <GradientStop Color="#FF6E6E6E"/>
                                            <GradientStop Color="#FFC2C2C2" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border x:Name="ElementEmptyArea" CornerRadius="0,4,4,0" Grid.Column="1">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                                    <GradientStop Color="#FFDEDEDE"/>
                                                    <GradientStop Color="#FFF1F1F1" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                        </Border>
                                        <ItemsPresenter HorizontalAlignment="Left"/>
                                    </Grid>
                                </Border>
                            </ControlTemplate>
                        </local:AgMenuTemplateListItem.Template>
                    </local:AgMenuTemplateListItem>
                    <local:AgMenuTemplateListItem Key="Vertical">
                        <local:AgMenuTemplateListItem.Template>
                            <ControlTemplate TargetType="local:AgMenu">
                                <Border CornerRadius="5,5,5,5" Padding="1,1,1,1" Background="#FFA3A2A3">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Border x:Name="ElementEmptyArea" CornerRadius="0,0,4,4" Grid.Row="1" Background="#FFEBEBEB"/>
                                        <ItemsPresenter VerticalAlignment="Top"/>
                                    </Grid>
                                </Border>
                            </ControlTemplate>
                        </local:AgMenuTemplateListItem.Template>
                    </local:AgMenuTemplateListItem>
                </local:AgMenuTemplateList>
            </Setter.Value>
        </Setter>
        <Setter Property="SubMenuStyleSelector">
            <Setter.Value>
                <menuDefaultStyle:AgMenuDefaultStyleSubMenuStyleSelector/>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AgPopupMenu">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AgPopupMenu">
                    <Grid>
                        <Border Margin="4,4,0,0" Background="#26000000" CornerRadius="4,4,4,4"/>
                        <Grid Margin="0,0,4,4">
                            <Border Background="#FF6E6E6E" CornerRadius="3,3,3,3"/>
                            <menuDefaultStyle:AgSubMenuDefaultStyleHelper Background="White"/>
                            <Border Background="#FFFFFFFF" CornerRadius="2,2,2,2" Margin="1,1,1,1">
                                <menuInternal:AgMenuScrollViewer x:Name="ItemsPresenterContainer" ScrollButtonClickMode="{TemplateBinding ScrollButtonClickMode}" Margin="0,0,0,1">
                                    <ItemsPresenter/>
                                </menuInternal:AgMenuScrollViewer>
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <menuInternal:AgMenuPanel Orientation="Vertical"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerTemplates" Value="{StaticResource ItemContainerTemplates}"/>
        <Setter Property="SubMenuStyle">
            <Setter.Value>
                <Style TargetType="local:AgPopupMenu">
                    <Setter Property="PopupOffset" Value="-3,1,1,0"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="#FF151515"/>
    </Style>

    <ControlTemplate x:Key="ScrollUpButtonTemplate" TargetType="menuInternal:AgMenuScrollButton">
        <Grid Background="Transparent">
            <vsm:VisualStateManager.VisualStateGroups>
                <vsm:VisualStateGroup x:Name="CommonStates">
                    <vsm:VisualState x:Name="Normal"/>
                    <vsm:VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="PathBrush" Storyboard.TargetProperty="Color" To="Black" Duration="0:0:0.01"/>
                        </Storyboard>
                    </vsm:VisualState>
                    <vsm:VisualState x:Name="Pressed">
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="PathBrush" Storyboard.TargetProperty="Color" To="Black" Duration="0:0:0.01"/>
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Path Stretch="Fill" Data="F1 M 403,290L 412,290L 408,282L 407,282L 403,290 Z " Height="8" Width="9" Margin="0,6,0,3">
                <Path.Fill>
                    <SolidColorBrush x:Name="PathBrush" Color="#FF848484"/>
                </Path.Fill>
            </Path>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="ScrollDownButtonTemplate" TargetType="menuInternal:AgMenuScrollButton">
        <Grid Background="Transparent">
            <vsm:VisualStateManager.VisualStateGroups>
                <vsm:VisualStateGroup x:Name="CommonStates">
                    <vsm:VisualState x:Name="Normal"/>
                    <vsm:VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="PathBrush" Storyboard.TargetProperty="Color" To="Black" Duration="0:0:0.01"/>
                        </Storyboard>
                    </vsm:VisualState>
                    <vsm:VisualState x:Name="Pressed">
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="PathBrush" Storyboard.TargetProperty="Color" To="Black" Duration="0:0:0.01"/>
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Path Stretch="Fill" Data="F1 M 407,287L 398,287L 402,295L 403,295L 407,287 Z " Height="8" Width="9" Margin="0,3,0,6">
                <Path.Fill>
                    <SolidColorBrush x:Name="PathBrush" Color="#FF848484"/>
                </Path.Fill>
            </Path>
        </Grid>
    </ControlTemplate>

    <Style TargetType="menuInternal:AgMenuScrollViewer">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="menuInternal:AgMenuScrollViewer">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <menuInternal:AgMenuScrollButton x:Name="BackwardButton"
                          ClickMode="{TemplateBinding ScrollButtonClickMode}"
                          Grid.Row="0"
                          Height="17"
                          Template="{StaticResource ScrollUpButtonTemplate}"
                          Visibility="Collapsed"/>
                        <menuInternal:AgMenuScrollContentPresenter x:Name="ContentPresenter" Grid.Row="1"/>
                        <menuInternal:AgMenuScrollButton x:Name="ForwardButton"
                          ClickMode="{TemplateBinding ScrollButtonClickMode}"
                          Grid.Row="2"
                          Height="17"
                          Template="{StaticResource ScrollDownButtonTemplate}"
                          Visibility="Collapsed"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="menuDefaultStyle:AgSubMenuDefaultStyleHelper">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="menuDefaultStyle:AgSubMenuDefaultStyleHelper">
                    <Rectangle Fill="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
    </Style>

    <Style TargetType="menuDefaultStyle:AgMenuSubItemArrowDefaultStyleHelper">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="menuDefaultStyle:AgMenuSubItemArrowDefaultStyleHelper">
                    <Path Stretch="Fill" Fill="{TemplateBinding Background}" Data="F1 M 394,286L 400,283L 400,282L 394,279L 394,286 Z " Height="7" Width="6"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
